﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;


namespace F3.Maps.OsmParser
{
    public class Log
    {
        string path;
        private static Log log = null;
                        
        private Log()
        {
            // TODO: make the path dynamic
            path = @"E:\Projects\Maps\OsmParser\OsmParser\bin\Debug\log.txt";
            
        }
        
        public void write(string message)
        {
            using (TextWriter writer = File.AppendText(this.path))
            {
                writer.WriteLine(DateTime.Now.ToString("dd/mm/yyyy hh:mm tt") + ": " + message);
            }
        }

        public static Log Current
        {
            get           
            { 
                if(log == null)
                {
                    log = new Log();
                }
                return log;
            }
            
        }
    }
}
